package com.ruoyi.resource.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.resource.mapper.SysBusinessResourceLabelMapper;
import com.ruoyi.resource.domain.SysBusinessResourceLabel;
import com.ruoyi.resource.service.ISysBusinessResourceLabelService;

/**
 * 标签Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-22
 */
@Service
public class SysBusinessResourceLabelServiceImpl implements ISysBusinessResourceLabelService 
{
    @Autowired
    private SysBusinessResourceLabelMapper sysBusinessResourceLabelMapper;

    /**
     * 查询标签
     * 
     * @param labelId 标签主键
     * @return 标签
     */
    @Override
    public SysBusinessResourceLabel selectSysBusinessResourceLabelByLabelId(Long labelId)
    {
        return sysBusinessResourceLabelMapper.selectSysBusinessResourceLabelByLabelId(labelId);
    }

    /**
     * 查询标签列表
     * 
     * @param sysBusinessResourceLabel 标签
     * @return 标签
     */
    @Override
    public List<SysBusinessResourceLabel> selectSysBusinessResourceLabelList(SysBusinessResourceLabel sysBusinessResourceLabel)
    {
        return sysBusinessResourceLabelMapper.selectSysBusinessResourceLabelList(sysBusinessResourceLabel);
    }

    /**
     * 新增标签
     * 
     * @param sysBusinessResourceLabel 标签
     * @return 结果
     */
    @Override
    public int insertSysBusinessResourceLabel(SysBusinessResourceLabel sysBusinessResourceLabel)
    {
        sysBusinessResourceLabel.setCreateTime(DateUtils.getNowDate());
        return sysBusinessResourceLabelMapper.insertSysBusinessResourceLabel(sysBusinessResourceLabel);
    }

    /**
     * 修改标签
     * 
     * @param sysBusinessResourceLabel 标签
     * @return 结果
     */
    @Override
    public int updateSysBusinessResourceLabel(SysBusinessResourceLabel sysBusinessResourceLabel)
    {
        sysBusinessResourceLabel.setUpdateTime(DateUtils.getNowDate());
        return sysBusinessResourceLabelMapper.updateSysBusinessResourceLabel(sysBusinessResourceLabel);
    }

    /**
     * 批量删除标签
     * 
     * @param labelIds 需要删除的标签主键
     * @return 结果
     */
    @Override
    public int deleteSysBusinessResourceLabelByLabelIds(Long[] labelIds)
    {
        return sysBusinessResourceLabelMapper.deleteSysBusinessResourceLabelByLabelIds(labelIds);
    }

    /**
     * 删除标签信息
     * 
     * @param labelId 标签主键
     * @return 结果
     */
    @Override
    public int deleteSysBusinessResourceLabelByLabelId(Long labelId)
    {
        return sysBusinessResourceLabelMapper.deleteSysBusinessResourceLabelByLabelId(labelId);
    }
}
